import java.util.Scanner;

//thread used for vewing info about server and testing
public class infoThread extends Thread{
	SepereServer main;
	
	public infoThread(SepereServer s)
	{
		super("infoThread");
		main=s;
	}
	
	public void run()
	{
		String input;
		Scanner in = new Scanner(System.in);
		while(true){
			System.out.print(">");
			input = in.next();
			if(input.equals("file"))
			{
				for(int i=0;i<main.fileList.size();i++)
					System.out.println(main.fileList.get(i).toString());
			}
			else if(input.equals("user"))
			{
				for(int i=0;i<main.userList.size();i++)
					System.out.println(main.userList.get(i).toString());
			}
			else if(input.equals("peer"))
			{
				for(int i=0;i<main.peerList.size();i++)
					System.out.println(main.peerList.get(i).toString());
			}
			else if(input.equals("quit"))
			{
				main.quit();
				break;
			}
				
		}
		
	}

}
